﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ManageCategory.aspx.vb" Inherits="Arwani.Backend_ManageCategory" %>

<%@ Register src="Menu.ascx" tagname="Menu" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title> Arwani Backend Panel</title>
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function postSortOrder(sortOrder,tableName, whereID, valueID) {
            $('#div_result').html('<input  type="image" src="../images/loading.gif" />');
            $.post("UpdateSortOrder.aspx", { sortOrder: sortOrder, tableName: tableName, whereID: whereID, valueID: valueID }, function (data) {
                $('#div_result').html(data);
            });
        }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="tablecontent">

    <table border="0" cellpadding="2" cellspacing="2" width="100%" align="center">
        <tr>
            <td align="center">
                <uc1:Menu ID="Menu1" runat="server" />
            </td>

        </tr>
        <tr>
        <td align="right">
            <asp:LinkButton ID="lnkAddNewCategory" runat="server" CausesValidation="False">Add New Category</asp:LinkButton>&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="lnkBackToDiv" runat="server">Back to Division</asp:LinkButton>&nbsp;&nbsp;
        </td>
        </tr>
                    <tr>
                <td align="center" style="height: 5px">
            <asp:Label ID="lblHeading" runat="server" Font-Size="XX-Large" 
                Font-Underline="True" ForeColor="Black">Category</asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <div id="div_result" style="color:Red"></div>
                    
                    </td>
            </tr>
        <tr>
        <td align="center">
            <asp:DataGrid ID="dgCats" runat="server" DataKeyField="catid" AutoGenerateColumns="False" Width="500px" 
            AllowPaging="True" CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="table">
                        <AlternatingItemStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateColumn Visible="false">
                                
                                <ItemTemplate>
                                    <asp:Image ID="imgCat" Width="100" ImageUrl='<%#getImage(DataBinder.Eval(Container.DataItem,"catpicture")) %>' runat="server" />
                                </ItemTemplate>
                                
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="catid" HeaderText="Category ID"></asp:BoundColumn>
                            <asp:BoundColumn DataField="catname" HeaderText="Category Name">
                            </asp:BoundColumn> 
                            <asp:TemplateColumn HeaderText="Sort Order">
                                <ItemTemplate>
                                    <asp:TextBox Width="45px" MaxLength="4" ID="txtSortOrder" runat="server" text='<%#DataBinder.Eval(Container.DataItem,"sortorder") %>' ></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"catid") %>' CommandName="Edit">Edit</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"catid") %>' CommandName="Delete">Delete</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <EditItemStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle Font-Bold="True" BackColor="#507CD1" ForeColor="White" />
                        <ItemStyle BackColor="#EFF3FB" />
                        <PagerStyle HorizontalAlign="Center" 
                            Mode="NumericPages" VerticalAlign="Middle" BackColor="#2461BF" 
                            ForeColor="White" />
                        <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    </asp:DataGrid>
        </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>
